<!DOCTYPE html>
<html>
<head>
    <title>Simulating IE Mouse Events Example</title>
    <script type="text/javascript" src="EventUtil.js"></script>
</head>
<body>
    <input type="button" value="Click me" id="myBtn" />
    <input type="button" value="Send click to the other button" id="myBtn2" />
    <p>This example works only in Internet Explorer.</p>
    <script type="text/javascript">
    
    (function(){
        var btn = document.getElementById("myBtn");
        var btn2 = document.getElementById("myBtn2");
        
        EventUtil.addHandler(btn, "click", function(event){
            alert("Clicked!");
            alert(event.screenX);   //100
        });

        EventUtil.addHandler(btn2, "click", function(event){
            //create event object
            var event = document.createEventObject();
            
            //initialize the event object
            event.view = window;
            event.detail = 0;
            event.screenX = 100;
            event.screenY = 0;
            event.clientX = 0;
            event.clientY = 0;
            event.ctrlKey = false;
            event.altKey = false;
            event.metaKey = false;
            event.shiftKey = false;
            event.button = 0;
            event.relatedTarget = null;
            
            //fire the event
            btn.fireEvent("onclick", event);

        });

    })();
    </script>
</body>
</html>
